
#include "iostream"
#include "string"
using namespace std;
int main() {
	string s[5] = { "a","b","c","d","e" };
	string text1;
	int k;
	cin >> text1;
	cin >> k;
	int len = text1.length();
	int p;
	if (len % k == 0)
		p = len / k;
	else
		p = len / k + 1;
	int cnt = 0;
	int now = k;
	while (cnt < p) {
		if (now <= len) {
			text1.insert(now, s[cnt % 5]);
			now += (k+1);
			cnt++;
			len++;
		}
		else {
			text1 += s[cnt % 5];
			len++;
			cnt++;
		}
	}
	cout << text1 << endl;
	return 0;
}
